<?php
include '../include/functions.php';
//set session save path
  session_save_path("../$session_path");
  // Initialize a session. 
  session_start(  );
            //session_destroy();             
  $count++;                         
  $sessionId = session_id();
//Connect To Database
dbConnect();
if($userID != "")
{
	$SQL = "SELECT Username FROM Users WHERE ID=$userID";
	$result = mysql_query($SQL) or die("Cannot query the database.<br>" . mysql_error());
	$myrow = mysql_fetch_array($result);
	$username = $myrow["Username"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//Dtd html 4.01 Transitional//EN"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
  <head>
    <title>JoshHughes.com Hockey Pool</title>
	<link rel="stylesheet" href="http://hockey.joshhughes.com/css/hockey.css" type="text/css">
    <script src="http://hockey.joshhughes.com/scripts/prototype.js" type="text/javascript"></script>
	<script src="http://hockey.joshhughes.com/scripts/scriptaculous.js" type="text/javascript"></script>
	<script src="http://hockey/joshhughes.com/scripts/hockey.js" type="text/javascript"></script>  </head>
<body>
<div id="pagewidth" >
	<div id="header" >
	
		<?PHP include_once("../layout/header.html"); ?>
		
	</div>
			<div id="wrapper" class="clearfix" > 
			<div id="maincol" >

			<?php

					$js="function smilie(emote) {\n document.reply.comments.value += emote;\n document.reply.comments.focus();\n}\n";
					require_once("config.inc.php");
					require_once("mysql.php");
					require_once("tags.php");
					require_once("censorship.php");
					require_once("headers.php");
					$moderaters=array($tinybb_moderators);
					if (in_array($username,$moderaters)) {
					  if (isset($_GET['id'])) {
						$sql="SELECT topicid FROM tinybb_posts WHERE id='$_GET[id]'";
						$result=mysql_query($sql);
						$row = mysql_fetch_array($result);
						$topicid=$row[topicid];
						$sql="DELETE FROM tinybb_posts WHERE id='$_GET[id]'";
						$result=mysql_query($sql);
						echo "<p>Post deleted: <a href=\"topic.php?id=$topicid\" class=\"permLink\">Back To Topic</a>";
					  }
					}
					else {
					  echo "<p><b class=\"nonpost\">You are not authorised to view this page.</b></p>\n<p>Please <a href=\"javascript:history.go(-1)\">go back</a> and try again.</p>\n";
					}
					require_once("footers.php");
					?>
			
			</div>
			<div id="leftcol" >
			
				<?PHP include_once("../layout/left_column.php"); ?>
		
			</div>
			
		</div>
		
		<div id="footer" >
		
			<?PHP include_once("../layout/footer.html"); ?>
			
		</div>
</div>
</body>
</html>